Repository navigation
Compile treesitter parsers with MinGW gcc on Windows - #21
Merged
Merged
Conversation
On Windows the tree-sitter CLI looks for MSVC and doesn't try a gcc on PATH, so with the README's MinGW setup every parser failed with "Failed to execute the C compiler ... program not found". CI didn't notice because its runner has MSVC. Point it at gcc (CC=gcc) when there's no cl on PATH and CC isn't set. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows the
tree-sitterCLI that nvim-treesitter uses to compile parsers looks for MSVC and ignores a MinGWgcconPATH. So with the README's setup (gcc from MinGW, no Visual Studio), every parser failed with "Failed to execute the C compiler … program not found". CI didn't catch it because thewindows-latestrunner has MSVC.Change
lazy/treesitter.lua: on Windows, whenCCisn't set andclisn't onPATHbutgccis, setvim.env.CC = "gcc"before installing parsers. It only affects Neovim's child processes, and MSVC setups (a VS developer shell, or an explicitCC) are left alone.Testing
On a fresh Windows setup (Neovim 0.12.6, WinLibs gcc 16.2 and make from winget, no MSVC):
CCin the environment, the config setsCC=gcc. Force-reinstallingtomldownloads, compiles and loads it.stylua --check .with StyLua 2.3.0 on an LF copy: clean.smoke: OK).